package com.yykj.order.center.server.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yykj.order.center.server.entity.ConsultationDetail;
import com.yykj.order.center.server.entity.ConsultationDoctor;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ConsultationDetailMapper extends BaseMapper<ConsultationDetail> {

    default List<ConsultationDetail> findByConsultationId(String consultationId){
        LambdaQueryWrapper<ConsultationDetail> consultationLambdaQueryWrapper = new LambdaQueryWrapper<>();
        consultationLambdaQueryWrapper.eq(ConsultationDetail::getConsultationId, consultationId);
        consultationLambdaQueryWrapper.orderByDesc(ConsultationDetail::getSort);
        return this.selectList(consultationLambdaQueryWrapper);
    }
}
